build:
	arch -x86_64 lime build html5 -debug -D game

test:
	# arch -x86_64 lime test html5 --port=3909 -D game
	haxelib run hxwell up ./Export/html5/bin --port 3909 --host 0.0.0.0

unpkg:
	haxelib run hxcpp /Users/rainy/Documents/haxelib-self/hxwz2-tools/bin/actbuilder_parser.cppia ./Assets/roles/${ROLE}.data ./Out/${ROLE}

mov2mp3:
	ffmpeg -i ${MOV} -acodec libmp3lame -ab 64k ${MOV}.mp3

build-editer:
	arch -x86_64 lime build html5 -debug -D editer 
	cp -rf ./Export/html5/bin/ /Users/rainy/Documents/haxelib-self/rainyt/anime-battle-editer/build/electron/games
test-editer:	
	lime test html5 -debug -D editer
	
build-runtime:
	arch -x86_64 lime build html5 -D game -D game_develop
	cp -rf Export/html5/bin/* Export/electron/bin/runtime

# 将资源上传到远程服务器，提供更新功能
upload:
	-rm -rf Export/electron/bin/update.zip
	cd Export/electron/bin; zip -r -x *.abn *.data -o update.zip ElectronSetup.js AnimeBattleNext.js ElectronTools.js assets/* editerAssets/* runtime/* 
	haxelib run aliyun-oss-upload Export/electron/bin/update.zip anime-battle-next:1000

build-mac:
	cd Export/electron/bin; npm run build-mac

build-win:
	cd Export/electron/bin; npm run build-win